import React, { Component } from 'react'
// 8.引入状态管理器
import store from './store'
export default class List1 extends Component {
  render() {
    return (
      <div>
        {/* 9.渲染数据 */}
        {
          store.getState().list
        }
        {/* 10。变更状态 */}
        <button onClick = {
          () => {
            store.dispatch({
              type: 'CHANGE_LIST',
              payload: [4, 5, 6]
            })
          }
        }>改变为 456</button>
      </div>
    )
  }
}
